package web2021.team1.lj.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;
import web2021.team1.lj.domain.RegisterLog;

/**
 * @Author imu_zxq
 * @Date 2021/5/20 17:14
 **/

@Repository
public class RegisterDao {
    @Autowired
    private JdbcTemplate jdbcTemplate;

    public void insertRegisterLog(RegisterLog registerLog){
        String sql = "INSERT INTO register_log(user_name, ip, register_datetime) VALUES(?,?,?)";
        Object[] args = {registerLog.getUserName(),registerLog.getIp(),registerLog.getRegisterDate()};
        jdbcTemplate.update(sql,args);
    }
}
